# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=marble
pkgver=24.08.2
pkgrel=0
pkgdesc="A Virtual Globe and World Atlas that you can use to learn more about Earth"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x, riscv64 and loongarch64 blocked by qt6-qtwebengine
arch="all !armhf !ppc64le !s390x !riscv64 !loongarch64"
url='https://marble.kde.org'
license="LGPL-2.1-or-later AND GPL-3.0-or-later"
depends_dev="
	gpsd-dev
	kcoreaddons5-dev
	kcrash5-dev
	kdoctools5-dev
	ki18n5-dev
	kio5-dev
	knewstuff5-dev
	kparts5-dev
	krunner5-dev
	kwallet5-dev	
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtlocation-dev
	qt5-qtserialport-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	qt5-qtwebengine-dev
	shared-mime-info
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/education/marble.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/marble-$pkgver.tar.xz"
options="!check" # Requires itself to be installed

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DMOBILE=ON \
		-DBUILD_MARBLE_APPS=YES
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
dff5a78ad8531f12ee8d17402bbecaa033492735d47c63da860d571a7d605615159c61f0946a9418666f310d6b319a71bcc95aaef20e543fcdd8e4618d1aa7c9  marble-24.08.2.tar.xz
"
